import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/components/Login'
import Home from '@/components/Home'

import Documents from '@/components/Documents/Documents'
import Templates from '@/components/Templates/Templates'
import Personals from '@/components/Personals/Personals'

import PersonalAll from '@/components/Personals/Items/router/PersonalAll'

import TemplateInfo from '@/components/Templates/Items/router/TemplateInfo'

import DocumentScore from '@/components/Documents/Items/router/DocumentScore'
import DocumentExam from '@/components/Documents/Items/router/DocumentExam'


Vue.use(Router);

export default new Router({
  mode: 'history',
  base:'/dist/',
  routes: [
    {
      path: '/Login',
      name: 'Login',
      component: Login,
      meta: {}
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: true,
      },
      children: [
        {
          path: '/Documents',
          name: 'Documents',
          component: Documents,
          meta: {
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: true,
          }
        },
        {
          path: '/Templates',
          name: 'Templates',
          component: Templates,
          meta: {
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: true,
          }
        },
        {
          path: '/Personals',
          name: 'Personals',
          component: Personals,
          meta: {
            // 添加该字段，表示进入这个路由是需要登录的
            requireAuth: true,
          },
        }
      ],
      redirect:'/Documents'
    },
    // Personals
    {
      path: '/PersonalAll',
      name: 'PersonalAll',
      component: PersonalAll,
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: true,
      }
    },

    // Templates
    {
      path: '/TemplateInfo',
      name: 'TemplateInfo',
      component: TemplateInfo,
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: true,
      }
    },

    // Documents
    {
      path: '/DocumentScore',
      name: 'DocumentScore',
      component: DocumentScore,
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: true,
      }
    },
    {
      path: '/DocumentExam',
      name: 'DocumentExam',
      component: DocumentExam,
      meta: {
        // 添加该字段，表示进入这个路由是需要登录的
        requireAuth: true,
      }
    },
  ]
})
